/**
 * Copyright(c) Hainan eKing Technology co., LTD
 *
 * @date 2013年8月13日
 * 	
 * Original Author: 郑兴(zhengxing)
 *
 * ChangeLog
 *
 */
package com.hnas.sys.service.system.mapper;

import com.hnas.core.mapper.Mapper;
import com.hnas.sys.orm.AuthorityResource;
import com.hnas.sys.service.system.dto.DTOAuthorityResource;

/**
 * @author 郑兴(zhengxing)
 *
 */
public class AuthorityResourceMapper extends Mapper<DTOAuthorityResource, AuthorityResource> {
	private static AuthorityResourceMapper userMapper;
	
	private AuthorityResourceMapper() {
		super(DTOAuthorityResource.class, AuthorityResource.class);
	}
	
	public static AuthorityResourceMapper getInstance() {
		if (userMapper == null) {
			userMapper = new AuthorityResourceMapper();
		}
		return userMapper;
	}
	
	public DTOAuthorityResource mapToValue(AuthorityResource entity) {
		DTOAuthorityResource value = super.mapToValue(entity);
		/*if(null != entity.getAuthority()) {
			value.setDtoAuthority(AuthorityMapper.getInstance().mapToValue(entity.getAuthority()));
		}*/
		if(null != entity.getResource()) {
			value.setDtoResource(ResourceMapper.getInstance().mapToValue(entity.getResource()));
		}
		return value;
	}
}
